/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.myapp.wicket.behaviors;

import org.apache.wicket.behavior.AbstractBehavior;
import org.apache.wicket.markup.html.IHeaderResponse;

/**
 * Behavior that sets the focus on 
 * the first input element on the page
 * 
 * Requires jQuery
 * 
 * @author Jeff
 */
public class InputElementFocusBehavior extends AbstractBehavior{

    @Override
    public void renderHead(IHeaderResponse response) {
        super.renderHead(response);
        response.renderJavascript("$(document).ready(function(){$(':text').first().focus();});", null);
                
    }
    
}
